// N 叉树 后序遍历
var postorder = function (root) {
  let res = []
  if (!root) return res
  let stack = [root]
  while (stack.length) {
    let node = stack.pop()
    res.unshift(node.val)
    for (let i = 0; i < node.children.length; i++) {
      stack.push(node.children[i])
    }
  }
  return res
}
